<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const reverseWords = (s) => {
      const arr = s.split(' ');
      const res = [];
      for (let i = 0; i < arr.length; i++) {
        res.push(arr[i].split('').reverse().join(''));
      }
      return res.join(' ');
    };
    console.log(reverseWords(s = "Let's take LeetCode contest"))
  </script>
</body>

</html>